import { defineStore } from "pinia";

export const useCounterStore = defineStore(
    "counter", //当前SPA中该状态的唯一名称
    {
        state: () => {
            return {
                count: 0
            };
        },
        getters: {},
        actions: {
            increment() {
                this.count++;
            }
        },
        persist: {
            enabled: true,
            strategies: [{
                key: "store",//自定义存储名称
                storage: sessionStorage,//自定义存储位置
            }]
        }
    }
);
